package Tween
{
	import Plugin.TweenObjectPlugin;
	import Plugin.TweenPlugin;
	
	import flash.filters.BitmapFilterQuality;
	import flash.filters.BlurFilter;
	import flash.filters.GlowFilter;
	
	public class BlurTween extends TweenObjectPlugin
	{
		public var startBlurX:Number=0;
		public var startBlurY:Number=0;
		
		public var endBlurX:Number=0;
		public var endBlurY:Number=0;
		
		public var quality:int=BitmapFilterQuality.LOW;
		
		private var filter:BlurFilter;
		
		public function BlurTween()
		{
			super();
			filter=new BlurFilter();
		}
		
		override protected function _update():void
		{
			if(time==0)return;
			
			var blurX:Number = 0;
			var blurY:Number = 0;
			blurX = easeing(time,startBlurX,endBlurX-startBlurX,duration);
			blurY = easeing(time,startBlurY,endBlurY-startBlurY,duration);
			filter.blurX=blurX;
			filter.blurY=blurY;
			filter.quality=quality;
			go.addFilter(filter);
		}
	}
}